//
//  MenuDarenZuoPingTableViewCell.m
//  Products_B
//
//  Created by lanou on 16/6/4.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "MenuDarenZuoPingTableViewCell.h"

@implementation MenuDarenZuoPingTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.picImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 50, 50)];
        self.picImageView.layer.cornerRadius = 25;
        self.picImageView.layer.masksToBounds = YES;
        self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(70, 10, 200, 20)];
        self.nameLabel.font = [UIFont systemFontOfSize:13];
        self.contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(70, 30, kWidth - 80, 60)];
        self.contentLabel.numberOfLines = 0;
        self.contentLabel.font = [UIFont systemFontOfSize:13];
        self.contentLabel.textColor = [UIColor grayColor];
        self.timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(kWidth - 10 - 80, 10, 80, 20)];
        self.timeLabel.font = [UIFont systemFontOfSize:12];
        self.timeLabel.textColor = [UIColor grayColor];
        self.timeLabel.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_picImageView];
        [self.contentView addSubview:_nameLabel];
        [self.contentView addSubview:_contentLabel];
        [self.contentView addSubview:_timeLabel];
    }
    return self;
}
- (void)setModel:(MenuDarenPinglunModel *)model{
    _model = model;
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.head_img] placeholderImage:nil completed:nil];
    self.nameLabel.text = model.nick;
    self.timeLabel.text = model.create_time;
    self.contentLabel.text = model.content;
}
@end
